<template>
    用户管理
    <el-table :data="tableData" style="width: 100%">
        <el-table-column label="unid" prop="unid" />
        <el-table-column label="用户名" prop="username" />
        <el-table-column label="昵称" prop="nickname" />
        <el-table-column label="vip等级" prop="vipLevel" />
        <el-table-column align="right">
            <template #header>
                操作
            </template>
            <template #default="scope">
                <el-button size="small" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
                <el-button size="small" type="danger" @click="handleDelete(scope.$index, scope.row)">删除</el-button>
            </template>
        </el-table-column>
    </el-table>
</template>
<script  setup>
import * as api from '@/api/index.js'
import { computed, ref, onMounted } from 'vue'
let tableData = ref([])
onMounted(async () => {
    let res = await api.getAllUsers()
    tableData.value = res.data.data
})
const handleEdit = (index, row) => {
    console.log(index, row)
}
const handleDelete = (index, row) => {
    console.log(index, row)
}



// onMounted(async () => {
//     let res = await api.getAllUsers()
//     tableData =
//     console.log(res.data.data);
//     tableData.value = res.data.data
//     console.log(res);
// })
</script>
<script>
    export default{
    meta:{
        title: 'yhgl', name: '用户管理',
        iconfont:'#icon-yonghu'
    }
}
</script>
  